﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using DTO;
using System.Collections;
using System.Data.OleDb;

namespace DAO
{
    public class LopHocDAO
    {
        public IList LayDanhSach()
        {
            ArrayList ds = new ArrayList();
            OleDbConnection cn;
            cn = DataProvider.ConnectionData();
            string strSQL;
            strSQL = "SELECT * FROM LOPHOC";
            OleDbCommand cmd = new OleDbCommand(strSQL, cn);
            OleDbDataReader dr;
            dr = cmd.ExecuteReader();
            while (dr.Read())
            {
                LopHocDTO lhDTO = new LopHocDTO();
                lhDTO.LTenLop = (string)dr["LTenLop"];
                lhDTO.LNamHoc = (string)dr["LNamHoc"];
                lhDTO.LGVCN = (int)dr["LGVCN"];
                lhDTO.LGhiChu = (string)dr["LGhiChu"];
                lhDTO.LTrangThai = (int)dr["LTrangThai"];
                ds.Add(lhDTO);
            }
            dr.Close();
            cn.Close();
            return ds;
        }

    }
}
